<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>新增</title>
    <%@include file="../../sys_common_head.jsp"%>
</head>
<body>
<form class="layui-form" action="">
    <div class="mainBox">
        <div class="main-container">
            <div class="main-container">
                <div class="layui-form-item">
                    <label class="layui-form-label">标题</label>
                    <div class="layui-input-block">
                        <input type="text" id="title" name="title"  autocomplete="off" placeholder="请输入标题"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">业务类型</label>
                    <div class="layui-input-block">
                        <input type="text" id="businessType" name="businessType"  autocomplete="off" placeholder="请输入业务类型"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">请求方法</label>
                    <div class="layui-input-block">
                        <input type="text" id="requestMethod" name="requestMethod"  autocomplete="off" placeholder="请输入请求方法"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">操作人</label>
                    <div class="layui-input-block">
                        <input type="text" id="operateName" name="operateName"  autocomplete="off" placeholder="请输入操作人"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">操作路径</label>
                    <div class="layui-input-block">
                        <input type="text" id="operateUrl" name="operateUrl"  autocomplete="off" placeholder="请输入操作路径"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">操作地址</label>
                    <div class="layui-input-block">
                        <input type="text" id="operateAddress" name="operateAddress"  autocomplete="off" placeholder="请输入操作地址"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">请求参数</label>
                    <div class="layui-input-block">
                        <input type="text" id="requestParam" name="requestParam"  autocomplete="off" placeholder="请输入请求参数"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">相应消息体</label>
                    <div class="layui-input-block">
                        <input type="text" id="responseBody" name="responseBody"  autocomplete="off" placeholder="请输入相应消息体"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">是否成功</label>
                    <div class="layui-input-block">
                        <input type="text" id="success" name="success"  autocomplete="off" placeholder="请输入是否成功"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">异常信息</label>
                    <div class="layui-input-block">
                        <input type="text" id="errorMsg" name="errorMsg"  autocomplete="off" placeholder="请输入异常信息"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">创建时间</label>
                    <div class="layui-input-block">
                        <input type="text" id="createTime" name="createTime"  autocomplete="off" placeholder="请输入创建时间"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">描述</label>
                    <div class="layui-input-block">
                        <input type="text" id="description" name="description"  autocomplete="off" placeholder="请输入描述"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">请求消息体</label>
                    <div class="layui-input-block">
                        <input type="text" id="requestBody" name="requestBody"  autocomplete="off" placeholder="请输入请求消息体"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">使用浏览器</label>
                    <div class="layui-input-block">
                        <input type="text" id="browser" name="browser"  autocomplete="off" placeholder="请输入使用浏览器"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">操作系统</label>
                    <div class="layui-input-block">
                        <input type="text" id="systemOs" name="systemOs"  autocomplete="off" placeholder="请输入操作系统"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">日志类型，登录日志，操作日志</label>
                    <div class="layui-input-block">
                        <input type="text" id="loggingType" name="loggingType"  autocomplete="off" placeholder="请输入日志类型，登录日志，操作日志"
                               class="layui-input">
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="data-save">
                <i class="layui-icon layui-icon-ok"></i>
                提交
            </button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</form>

<script>
    layui.use(['form', 'jquery','laydate'], function () {
        let form = layui.form;
        let $ = layui.jquery;
        var laydate = layui.laydate;
        laydate.render({
            elem: '#birthday' //指定元素
        });

        form.on('submit(data-save)', function (data) {
            $.ajax({
                url: '<%=request.getContextPath()%>/logging/syslogging/save',
                data: JSON.stringify(data.field),
                dataType: 'json',
                contentType: 'application/json',
                type: 'post',
                success: function (result) {
                    if (result.code == 0) {
                        layer.msg(result.msg, {icon: 1, time: 1000}, function () {
                            parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
                            parent.layui.table.reload("data-table");
                        });
                    } else {
                        layer.msg(result.msg, {icon: 2, time: 1000});
                    }
                }
            })
            return false;
        });
    })
</script>

</body>
</html>